home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / xcdplayer / main.c < prev    next >
C/C++ Source or Header  |  1994-08-01  |  2KB  |  81 lines

  1. /*
  2.  * Copyright (C) 1990 Regents of the University of California.
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and
  5.  * its documentation for any purpose is hereby granted without fee,
  6.  * provided that the above copyright notice appear in all copies and that
  7.  * both that copyright notice and this permission notice appear in
  8.  * supporting documentation, and that the name of the University of
  9.  * California not be used in advertising or publicity pertaining to
  10.  * distribution of the software without specific, written prior
  11.  * permission.  the University of California makes no representations
  12.  * about the suitability of this software for any purpose.  It is provided
  13.  * "as is" without express or implied warranty.
  14.  */
  15.  
  16. # include <stdio.h>
  17.  
  18. # include <X11/Intrinsic.h>
  19. # include <X11/StringDefs.h>
  20.  
  21. # include "debug.h"
  22. # include "cdrom_globs.h"
  23.  
  24. Widget        top_form;
  25.  
  26. void
  27. main(argc, argv)
  28.     int        argc;
  29.     char        **argv;
  30. {
  31.     static void    chk_debug();
  32.  
  33.     chk_debug(argc, argv);
  34.  
  35.     /* gets resources, & creates main form */
  36.     top_form = top_setup(argc, argv);
  37.  
  38. #if 0
  39.     if (cdrom_open() == -1) /* (uses a resource, so done after top_setup) */
  40.         exit(1); /* perhaps a bit drastic */
  41. #endif
  42.     cdrom_open();
  43.  
  44.     logo_setup(top_form);
  45.  
  46.     button_setup(top_form);
  47.  
  48.     program_form_setup(top_form);
  49.  
  50.     top_start();
  51.  
  52.     update_status(NULL, NULL);
  53.  
  54.     XtAppMainLoop(appc);
  55.  
  56.     exit(0);
  57. }
  58.  
  59. static void
  60. chk_debug(argc, argv)
  61.     int    argc;
  62.     char    **argv;
  63. {
  64.     int    i;
  65.  
  66.     /* ugly hack */
  67.     for (i = 1; i < argc; i++) {
  68.         if (strcmp(argv[i], "-debug") == 0) {
  69.             debug = True;
  70.             break;
  71.         }
  72.     }
  73. }
  74.  
  75. void
  76. usage() {
  77.     (void) fprintf(stderr, "usage: xcdplayer [-debug]\n");
  78.  
  79.     exit(1);
  80. }
  81.